<template>
  <uni-popup ref="popup">
    <view class="pop-content">
      <text class="title">{{ title }}</text>
      <view class="con hot">
        {{ text }}
      </view>
      <view class="btn-group" @click="close">
        <image
          class="close-img"
          src="/static/guanbi2-slices.png"
          mode="aspectFit"
        ></image>
      </view>
    </view>
  </uni-popup>
</template>

<script>
/**
 * 自定义 确认对话框
 * @prop title 标题
 * @prop text 提示内容
 * @prop cancelText 取消按钮文字
 * @prop confirmText 确认按钮文字
 * @event onConfirm 确认按钮点击时触发
 */
export default {
  data() {
    return {};
  },
  props: {
    title: String,
    text: String,
  },
  methods: {
    open() {
      this.$refs.popup.open();
    },
    close() {
      this.$refs.popup.close();
    },
  },
};
</script>

<style scoped lang="scss">
.pop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 600rpx;
  padding-top: 36rpx;
  background-color: #fff;
  border-radius: 24rpx;
  // overflow: hidden;
  .title {
    font-size: 42rpx;
    color: #333;
    line-height: 58rpx;
    font-weight: 700;
  }
  .con {
    margin: 30rpx 30rpx 0 30rpx;
  }
  .hot {
    width: 520rpx;
    font-size: 30rpx;
    color: #222;
    line-height: 44rpx;
  }
  .btn-group {
    height: 50rpx;
  }
  .close-img {
    position: relative;
    top: 120rpx;
    left: 50%;
    margin-left: -40rpx;
    width: 80rpx;
    height: 80rpx;
  }
}
</style>
